import Person from './pojo/Person.js';
import Monster from './pojo/Monster.js';
import ImperialSword from './pojo/ImperialSword.js'
import SnowLeopard from './pojo/SnowLeopard.js'

let FatherObj = {
    c: 100
}

let Obj = {
    a: 1,
}

Object.setPrototypeOf(Obj, FatherObj)
Object.defineProperty(Obj, 'b', {
    value: 2,
    writable: true,
    enumerable: true,
    configurable: false

})


Object.defineProperty(Obj, 'b', {
    value: 3,
    writable: true,
    enumerable: true,
    configurable: false
})

for (const key in Obj) {
    if (Object.prototype.hasOwnProperty.call(Obj, key)) {
        const element = Obj[key];
        console.log(element);

    }
}
console.log(Obj.c);


// 创建 Person 和 Monster 类的实例
let personInstance = new Person('苏陈凤', 100, 100, 20000, 20, 200, 30, '', '', 1);
let monsterInstance = new Monster('哥布林', 100, 100, 10000, 10, 100, 10, '', '', 1)
// 创建 SnowLeopard 和 ImperialSword 的实例
let snowLeopard = new SnowLeopard();
let imperialSword = new ImperialSword();

console.log(`${personInstance.name}的攻击力为${personInstance.attack}`)

personInstance.useWeapon(snowLeopard)

console.log(personInstance.attack)



console.log(monsterInstance.hp);
